extends Area2D

func _ready() -> void:
	$AnimationPlayer.play("active")


func _on_body_entered(body: Node2D) -> void:
	if body.name == "Player":
		$AnimationPlayer.play("destroy")
		PlayerData.Coin += 1
		await $AnimationPlayer.animation_finished
		queue_free()
